from fastapi import FastAPI, Depends
from configuration.config import ProfileSettings, ServerSettings
from myProfile.api import signups, logins, profiles
from myProfile.api import psychotests, pmhs, fmhs, therapies
from myProfile.api import medications, interventions, events

profile_app = FastAPI()
profile_app.include_router(signups.router)
profile_app.include_router(logins.router)
profile_app.include_router(profiles.router)
profile_app.include_router(psychotests.router)
profile_app.include_router(pmhs.router)
profile_app.include_router(fmhs.router)
profile_app.include_router(therapies.router)
profile_app.include_router(medications.router)
profile_app.include_router(interventions.router)
profile_app.include_router(events.router)


def build_config():
    return ProfileSettings()


def fetch_config():
    return ServerSettings()


@profile_app.get('/index')
def index_profile(config: ProfileSettings = Depends(build_config),
                  fconfig: ServerSettings = Depends(fetch_config)):
    return {
        'project_name': config.application,
        'webmaster': config.webmaster,
        'created': config.created,
        'development_server': fconfig.development_server,
        'dev_port': fconfig.dev_port
        }
